package com.sikaryofficial.system.api;

import com.sikaryofficial.common.core.constant.ServiceNameConstants;
import com.sikaryofficial.common.core.domain.R;
import com.sikaryofficial.system.api.domain.SysFile;
import com.sikaryofficial.system.api.factory.RemoteFileMD5FallbackFactory;
import com.sikaryofficial.system.api.model.FileMd5VO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 文件服务
 *
 * @author qinjinyuan
 */
@FeignClient(contextId = "remoteFileMD5Service", value = ServiceNameConstants.BACKEND_SERVICE, fallbackFactory = RemoteFileMD5FallbackFactory.class)
public interface RemoteFileMD5Service {
    /**
     * 获取文件MD5详细信息
     */
    @GetMapping(value = "/fileMd5/{md5}")
    R<SysFile> getInfo(@PathVariable("md5") String md5);

    /**
     * 新增文件MD5
     */
    @PostMapping(value = "/fileMd5/add")
    R<Boolean> add(@RequestBody FileMd5VO fileMd5);
}
